import Vue from "vue";
import Vuex from "vuex";
import state from "./state";
import mutations from "./mutations";
import createPersistedState from "vuex-persistedstate";

import { dataStore } from "./module";
// const dataState = createPersistedState({
//   paths: ["data"]
// });
Vue.use(Vuex);

export default new Vuex.Store({
  state,
  // actions: {
  //   changeCity (ctx, city) {
  //     ctx.commit('changeA', city)
  //   }
  // },这里可以不调用actions，直接去commit
  mutations,
  modules: {
    dataStore
  },
  plugins: [createPersistedState()]
});
